package com.lyh.jnademo.service;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Platform;
import org.springframework.stereotype.Component;

/**
 * @author lyh
 * @version 1.0
 * @date 2019/10/11
 */
@Component
public class DllCenter {

    public interface CLibrary extends Library {
        CLibrary INSTTANCE = (CLibrary) Native.loadLibrary("Dll3" , CLibrary.class);

        int Add(int a,int b);
        int Sub(int a,int b);
    }

    public int dllAdd(int a, int b) {
        return CLibrary.INSTTANCE.Add(a, b);
    }

}
